package com.jinxin.platform.cdacscontrolmgr.bean.enums;

/**
 * All rights Reserved, Designed By www.beonelot.com
 *
 * @version: V1.0
 * @Copyright: www.beonelot.com Inc. All rights reserved.
 * @Description：
 * @Date: 2021-03-03
 * @Author: Lingnan
 **/

/**
 * 人脸识别 错误码定义
 */
public enum ErrorCodeEnum {
    CODE_0("0","已成功处理消息"),
    CODE_1("1","所接收消息与本地协议不匹配"),
    CODE_2("2","无法识别的消息ID"),
    CODE_3("3","消息内容中存在错误的值"),
    CODE_4("4","未通过认证"),
    CODE_5("5","系统繁忙"),
    CODE_6("6","资源不足"),
    CODE_7("7","系统功能授权失败"),
    CODE_8("8","系统功能已授权"),
    CODE_9("9","固件版本不匹配"),
    CODE_10("10","文件下载失败"),
    CODE_11("11","文件完整性校验失败"),
    CODE_12("12","获取4G信息失败"),
    CODE_13("13","ping 命令失败"),
    CODE_14("14","系统功能未授权"),
    CODE_15("15","操作失败"),
    CODE_16("16","人脸已经存在"),
    CODE_20("20","数据录入达到上限"),
    CODE_21("21","记录已经存在"),
    CODE_22("22","记录不存在"),
    CODE_23("23","写入数据失败"),
    CODE_24("24","读取数据失败"),
    CODE_25("25","提取特征失败"),
    CODE_26("26","人像质量差(Q值过低)"),
    CODE_30("30","WG卡号不支持模糊查找"),
    CODE_35("35","图像解码失败"),
    CODE_36("36","图像太大,用于提取特征的jpg图像不能超过2M"),
    CODE_37("37","归一化图像失败"),
    CODE_38("38","人脸尺寸太小"),
    CODE_39("39","人像质量太差"),
    CODE_40("40","图像中人脸数不为1"),
    CODE_41("41","图像中人脸不完整"),
    CODE_50("50","WIFI未连接"),
    CODE_51("51","超时未检测到有效人脸"),
    CODE_52("52","实人认证时不配合"),
    CODE_53("53","实人认证时人脸移出"),
    CODE_54("54","实人认证时出现非活体"),
    CODE_55("55","实人认证时人脸尺寸变动幅度过大"),
    CODE_70("70","建立通话失败"),
    CODE_71("71","通话关闭失败");

    private String code;
    private String desc;

    ErrorCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    // 普通方法
    public static String getDesc(String code) {
        for (ErrorCodeEnum c : ErrorCodeEnum.values()) {
            if (c.getCode().equals(code)) {
                return c.desc;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
